home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 2,801 to 2,900 / aol-file-protocol-4400-2801-to-2900.zip / AOLDLs / C++ Files Library / HyperCuber Source / HyperCuber 2.0 Source.sit / HyperCuber 2.0 Source / HyperCuber Errors.cp < prev    next >
Text File  |  1993-08-26  |  2KB  |  63 lines

  1. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2. //| HyperCuber Errors.cp
  3. //|
  4. //| This file contains error-handling code
  5. //|___________________________________________________________________________
  6.  
  7. #include "HyperCuber Errors.h"
  8.  
  9.  
  10. //============================ Prototypes ============================\\
  11.  
  12. void terminal_error(short error);
  13. void general_error(short error);
  14.  
  15.  
  16.  
  17. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. //| Procedure: terminal_error
  19. //|
  20. //| Purpose: Display error dialog and exit.
  21. //|
  22. //| Parameters: error: the error code
  23. //|__________________________________________________
  24.  
  25. void terminal_error(short error)
  26. {
  27.  
  28.     Str255 error_string;
  29.     GetIndString(error_string, TERMINAL_ERRORS_STRN_ID, error);    //  Set up the error text
  30.  
  31.     ParamText(error_string, NULL, NULL, NULL);                    //  Display error alert
  32.  
  33.     short item = Alert(TERMINAL_ERROR_ALERT_ID, NULL);
  34.  
  35.     ExitToShell();                                                //  Exit
  36.  
  37. }    //==== terminal_error() ====\\
  38.  
  39.  
  40.  
  41. //|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. //| Procedure: general_error
  43. //|
  44. //| Purpose: Display error dialog.
  45. //|
  46. //| Parameters: error: the error code
  47. //|__________________________________________________
  48.  
  49. void general_error(short error)
  50. {
  51.  
  52.     Str255 error_string;
  53.     GetIndString(error_string, GENERAL_ERRORS_STRN_ID, error);    //  Set up the error text
  54.  
  55.     ParamText(error_string, NULL, NULL, NULL);                    //  Display error alert
  56.  
  57.     short item = Alert(GENERAL_ERROR_ALERT_ID, NULL);
  58.  
  59. }    //==== general_error() ====\\
  60.  
  61.  
  62.  
  63.